xl: centralize BDF parsing in to libxl
authorGianni Tedesco <gianni.tedesco@citrix.com>
Wed, 4 Aug 2010 13:24:19 +0000 (14:24 +0100)
committerGianni Tedesco <gianni.tedesco@citrix.com>
Wed, 4 Aug 2010 13:24:19 +0000 (14:24 +0100)
commitb854bf1435861975c464c313023497f1adcce973
tree122277104cbebee1a472b160998aeb51fc0fde35
parentf74035d3b1e827ff6ff1873e2f10feb011a8d0d2
xl: centralize BDF parsing in to libxl

Introduce a new libxl call libxl_device_pci_parse_bdf() and use it
consistently.

This patch also fixes an infinite loop bug in xl create. If there is a
parse-error on any pci config file entry then xl will attempt to skip it, but
since num_pcidevs is used to index the config list and is not incremented when
skipping, this caused an infinite loop. Solve that problem by introducing a new
loop counter variable.

Note that virtual PCI slots are not parsed by the new code. However this is
a step towards support for virtual slots and multi-function device assignment
since only one location in the code will need to be changed now.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
tools/libxl/libxl.h
tools/libxl/libxl_pci.c
tools/libxl/xl_cmdimpl.c